import HttpService from '../../app/services/httpService.js';

class GroupaliasService extends HttpService {
    constructor($http, $q){
        super($http, $q)

        this.URL = this.baseUrl();

        this.OBJ = {
        	GroupaliasListUrl: this.URL + '/groupalias/lists?race_id=',
            GroupaliasCreateUrl: this.URL + '/groupalias/create?race_id=',
            GroupaliasDetailUrl: this.URL + '/groupalias/detail?aid=',
            GroupaliasUpdateUrl: this.URL + '/groupalias/update?aid=',
        }

    }

    /* 获取分组列表 */
    getGroupaliasList(headers, search) {
        return this.getRequest(this.OBJ.GroupaliasListUrl, headers, search);
    }
    
    /* 新增分组 */
    postGroupaliasCreate(params, headers, search) {
        return this.postRequest(this.OBJ.GroupaliasCreateUrl, params, headers, search);
    }

    /* 获取分组详情 */
    getGroupaliasDetail(headers, search) {
        return this.getRequest(this.OBJ.GroupaliasDetailUrl, headers, search);
    }
    
    /* 更新分组 */
    postGroupaliasUpdate(params, headers, search) {
        return this.postRequest(this.OBJ.GroupaliasUpdateUrl, params, headers, search);
    }

}

export default GroupaliasService;